package dk.viauc.cmclang.intlang;

import javax.swing.*;

import dk.viauc.cmclang.intlang.ast.AST;
import dk.viauc.cmclang.intlang.ast.Program;


public class TestDriverChecker
{
	private static final String EXAMPLES_DIR = "C:\\Users\\Michal\\Documents\\7thSemester\\CMC\\workspace\\cmc";
	
	
	public static void main( String args[] )
	{
		JFileChooser fc = new JFileChooser( EXAMPLES_DIR );
		
		if( fc.showOpenDialog( null ) == fc.APPROVE_OPTION ) {
			SourceFile in = new SourceFile( fc.getSelectedFile().getAbsolutePath() );
			IScanner s = new Scanner( in );
			IParser p = new ParserAST( s );
			Checker c = new Checker();
			Program program = (Program)p.parseProgram();
			AST ast = (AST) p.parseProgram();
			c.check( (Program) ast );
			Encoder enc = new Encoder();
			enc.encode(program);
		}
	}
}